package cn.itlaobing.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.itlaobing.entity.Student;
import cn.itlaobing.service.StudentService;

@Controller
@RequestMapping("/students")
public class StudentController {

	@Autowired
	private StudentService studentService;
	
	@RequestMapping()
	public String index(Model model) {
		Student student=studentService.findById(1);
		model.addAttribute(student);
		return "/students/index";
	}
	
}
